<?php

namespace App\Http\Model;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Redis;
use App\Http\Model\AudioApi;


class ActivityMall extends Base
{
    protected $table = 'activity_mall_log';

    public function __construct(array $attributes = [])
    {
        parent::__construct($this->table, $attributes);
    }

    /*
     * 活动赠送商品记录
     * @param $user_id  赠送用户id
     * @param $goods_id  商品id
     * @param $goods_type  商品类型
     * @param $time_limit  赠送时间
     * @param activity_type  活动类型
     * @param $send_type  活动内赠送类型
     * */
    public function create($user_id,$goods_id,$goods_type,$time_limit,$activity_type,$send_type)
    {
        $data['user_id'] = $user_id ?? 0;
        $data['goods_id'] = $goods_id ?? 0;
        $data['goods_type'] = $goods_type ?? 0;
        $data['time_limit'] = $time_limit ?? 0;
        $data['activity_type'] = $activity_type ?? 1;
        $data['send_type'] = $send_type ?? 1;
        return DB::table($this->table)->insert($data);
    }


}